package com.ruoyi.equ.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.equ.service.IEquBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.equ.mapper.EquBrandMapper;
import com.ruoyi.equ.domain.EquBrand;

/**
 * 设备品牌Service业务层处理
 *
 * @author ruoyi
 * @date 2025-11-08
 */
@Service
public class EquBrandServiceImpl implements IEquBrandService
{
    @Autowired
    private EquBrandMapper equBrandMapper;

    /**
     * 查询设备品牌
     *
     * @param brandId 设备品牌主键
     * @return 设备品牌
     */
    @Override
    public EquBrand selectEquBrandByBrandId(Long brandId)
    {
        return equBrandMapper.selectEquBrandByBrandId(brandId);
    }

    /**
     * 查询设备品牌列表
     *
     * @param equBrand 设备品牌
     * @return 设备品牌
     */
    @Override
    public List<EquBrand> selectEquBrandList(EquBrand equBrand)
    {
        return equBrandMapper.selectEquBrandList(equBrand);
    }

    /**
     * 新增设备品牌
     *
     * @param equBrand 设备品牌
     * @return 结果
     */
    @Override
    public int insertEquBrand(EquBrand equBrand)
    {
        equBrand.setCreateTime(DateUtils.getNowDate());
        return equBrandMapper.insertEquBrand(equBrand);
    }

    /**
     * 修改设备品牌
     *
     * @param equBrand 设备品牌
     * @return 结果
     */
    @Override
    public int updateEquBrand(EquBrand equBrand)
    {
        equBrand.setUpdateTime(DateUtils.getNowDate());
        return equBrandMapper.updateEquBrand(equBrand);
    }

    /**
     * 批量删除设备品牌
     *
     * @param brandIds 需要删除的设备品牌主键
     * @return 结果
     */
    @Override
    public int deleteEquBrandByBrandIds(Long[] brandIds)
    {
        return equBrandMapper.deleteEquBrandByBrandIds(brandIds);
    }

    /**
     * 删除设备品牌信息
     *
     * @param brandId 设备品牌主键
     * @return 结果
     */
    @Override
    public int deleteEquBrandByBrandId(Long brandId)
    {
        return equBrandMapper.deleteEquBrandByBrandId(brandId);
    }
    /**
     * 查询所有设备品牌名称
     * @return List<String>
     */
    @Override
    public List<String> getAllBrandName() {
        return equBrandMapper.getAllBrandName();
    }
}
